package se.sics.drsm.messages;

import se.sics.drsm.model.DRSMAddress;

import java.util.List;

/**
 * The <code>JoinGroupResponse</code> class.
 *
 * @author Shadid Chowdhury <msrch@kth.se>
 */
public final class JoinGroupResponse extends DRSMMessage {

    private static final long serialVersionUID = 5192768133925410334L;

    private boolean successful;
    private DRSMAddress self;
    private List<DRSMAddress> successors, predecessors;

    public JoinGroupResponse(DRSMAddress source, DRSMAddress destination,
                             boolean successful, DRSMAddress self, List<DRSMAddress> successors,
                             List<DRSMAddress> predecessors) {
        super(source, destination);
        this.successful = successful;
        this.self = self;
        this.successors = successors;
        this.predecessors = predecessors;
    }

    public DRSMAddress getSelf() {
        return self;
    }

    public List<DRSMAddress> getSuccessors() {
        return successors;
    }

    public List<DRSMAddress> getPredecessors() {
        return predecessors;
    }

    public boolean isSuccessful() {
        return successful;
    }

}
